﻿<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        FBillDate.SetValue(DateTime.Now.ToString("yyyy/MM/dd"));
    }
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
    <title>帐号列表</title>
    <script type="text/javascript" src="/Scripts/Commen.js"></script>
    <script type="text/javascript" src="/Scripts/SD_SaleOrder/SD_BarcodeScan.js"></script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <!--销售单明细数据源-->
    <ext:Store ID="SaleOrderDetailListStore" IDMode="Explicit" runat="server" RemoteSort="true"
        SkipIdForNewRecords="false" UseIdConfirmation="false" SerializationMode="Complex" AutoLoad="false"  WarningOnDirty="false">
        <Proxy>
            <ext:HttpProxy Url="/SaleOrder/GetSaleOrderDetailListByFParentId/" />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="FId" Root="data" TotalProperty="total">
                <Fields>
                    <ext:RecordField Name="FId" DefaultValue="" />
                    <ext:RecordField Name="FParentId" />
                    <ext:RecordField Name="FBarcode" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="FParentId" Value="#{FIdH}.getValue()" Mode="Raw" />
        </BaseParams>
    </ext:Store>
    <!--销售单数据源-->
    <ext:Store ID="SaleOrderEidtStore" runat="server" AutoLoad="false">
        <Proxy>
            <ext:HttpProxy Url="/SaleOrder/GetSaleOrderMsgByFId/" />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="FId" Root="data" TotalProperty="total">
                <Fields>
                    <ext:RecordField Name="FId" />
                    <ext:RecordField Name="FNumber" />
                    <ext:RecordField Name="FBillDate" />
                    <ext:RecordField Name="FBusinessCategoryId" />
                    <ext:RecordField Name="FCustomerName" />
                    <ext:RecordField Name="FCustomerPhone" />
                    <ext:RecordField Name="FCustomerMobile" />
                    <ext:RecordField Name="FCustomerAddress" />
                    <ext:RecordField Name="FCreateTime" />
                    <ext:RecordField Name="FCreatorId" />
                    <ext:RecordField Name="FModifyTime" />
                    <ext:RecordField Name="FModifierId" />
                    <ext:RecordField Name="FApproveTime" />
                    <ext:RecordField Name="FApproverId" />
                    <ext:RecordField Name="FStatusId" />
                    <ext:RecordField Name="FRemark" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="FId" Value="#{FIdH}.getValue()" Mode="Raw" />
        </BaseParams>
        <Listeners>
            <BeforeLoad Handler="#{EditFormPanel}.el.mask('正在加载信息...', 'x-mask-loading');" />
            <LoadException Handler="#{EditFormPanel}.el.unmask();" />
            <Load Fn="SD_BarcodeScan.Mgr.formStoreLoaded" />
        </Listeners>
    </ext:Store>
    <!--销售类型数据源-->
    <ext:Store ID="BillTypeStore" runat="server" AutoLoad="true">
        <Proxy>
            <ext:HttpProxy Url="/SaleOrder/GetSaleOrderBillTypeList/" />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="FID" Root="data" TotalProperty="total">
                <Fields>
                    <ext:RecordField Name="FID" />
                    <ext:RecordField Name="FName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <!--当前编辑帐号的FId-->
    <ext:Hidden ID="FIdH" IDMode="Explicit" runat="server" Text="" AutoDataBind="true">
    </ext:Hidden>
    <ext:Viewport ID="AccountViewport" runat="server" Layout="BorderLayout">
        <Items>
            <ext:FormPanel ID="EditFormPanel" runat="server" Title="销售订单(出货)信息" Region="North"
                Split="true" Height="150" Collapsible="true" Layout="BorderLayout" Padding="5"
                AnchorHorizontal="100%" LabelWidth="100">
                <TopBar>
                    <ext:Toolbar ID="TopBar" runat="server">
                        <Items>
                            <ext:DisplayField ID="DisplayField1" runat="server" StyleSpec="color:Red;" Text="注意：审核订单后方可起效！" />
                            <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                            </ext:ToolbarFill>
                            <ext:Button ID="Button2" runat="server" Text="新增" Icon="Add">
                                <Listeners>
                                    <Click Fn="SD_BarcodeScan.Mgr.resetEditData" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button1" runat="server" Text="保存" Icon="Disk">
                                <Listeners>
                                    <Click Fn="SD_BarcodeScan.Mgr.saveMsg" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button9" runat="server" Text="审核" Icon="Accept">
                                <Listeners>
                                    <Click Fn="SD_BarcodeScan.Mgr.approveOrder" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button10" runat="server" Text="反审核" Icon="Cross">
                                <Listeners>
                                    <Click Fn="SD_BarcodeScan.Mgr.unApproveOrder" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:Panel ID="Panel1" runat="server" Header="false" Layout="HBoxLayout" LabelWidth="100"
                        Region="Center" Width="560" Split="true" Border="false">
                        <Items>
                            <ext:Panel ID="Panel2" runat="server" Border="false" Header="false" Layout="FormLayout"
                                LabelAlign="Left" Padding="5">
                                <Items>
                                    <ext:TextField ID="FNumber" runat="server" FieldLabel="销售编号" Disabled="true" Width="137" />
                                    <ext:DateField ID="FBillDate" runat="server" FieldLabel="销售日期" AllowBlank="false"
                                        Width="137" Format="yyyy/MM/dd" />
                                    <ext:ComboBox ID="FBusinessCategoryId" FieldLabel="销售类型" runat="server" StoreID="BillTypeStore"
                                        TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" DisplayField="FName"
                                        ValueField="FID" Width="137" SelectedIndex="0" />
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel5" runat="server" Border="false" Layout="FormLayout" LabelAlign="Left"
                                Padding="5">
                                <Items>
                                    <ext:TextField ID="FCustomerName" runat="server" FieldLabel="客户名称" Width="150" AllowBlank="false"
                                        BlankText="客户名称不能为空" />
                                    <ext:TextField ID="FCustomerMobile" runat="server" FieldLabel="客户手机" Width="150" />
                                    <ext:TextField ID="FCustomerPhone" runat="server" FieldLabel="客户电话" Width="150" />
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel4" runat="server" Border="false" Header="false" Layout="FormLayout"
                                LabelAlign="Right" LabelWidth="70" Padding="5">
                                <Items>
                                    <ext:TextField ID="FCustomerAddress" runat="server" FieldLabel="客户地址" Width="350" />
                                    <ext:TextArea ID="FRemark" runat="server" FieldLabel="备注" Width="350" Height="50" />
                                </Items>
                            </ext:Panel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
            <ext:FormPanel ID="SearchFormPanel" runat="server" Title="扫描产品" Region="West" Width="250"
                Split="true" Collapsible="true" Layout="FormLayout" Padding="5" LabelWidth="55">
                <Items>
                    <ext:DisplayField runat="server" StyleSpec="color:Red;" Text="按回车键确认" />
                    <ext:TextField ID="FBarcodeTFS" runat="server" FieldLabel="条形码" AnchorHorizontal="100%">
                        <Listeners>
                            <SpecialKey Fn="SD_BarcodeScan.Mgr.barcodeScan" />
                        </Listeners>
                    </ext:TextField>
                    <ext:DisplayField ID="OperationMsgTF" runat="server" StyleSpec="color:Red;" Text="" />
                </Items>
            </ext:FormPanel>
            <ext:Panel ID="Panel3" runat="server" Region="Center" Layout="AccordionLayout" Split="true"
                Header="false">
                <Items>
                    <ext:GridPanel ID="SaleOrderDetailGrid" runat="server" Border="false" StoreID="SaleOrderDetailListStore"
                        TrackMouseOver="true" ClicksToEdit="0" Region="Center" AutoExpandColumn="FBarcode">
                        <TopBar>
                            <ext:Toolbar ID="Toolbar2" runat="server">
                                <Items>
                                    <ext:DisplayField runat="server" Text="已扫描条码" />
                                    <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                                    <ext:Button ID="Button8" runat="server" Text="删除条码" Icon="ApplicationDelete">
                                        <Listeners>
                                            <Click Fn="SD_BarcodeScan.Mgr.deleteSelectedBarcode" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ColumnID="FId" DataIndex="FId" Hidden="true">
                                </ext:Column>
                                <ext:Column ColumnID="FBarcode" DataIndex="FBarcode" Header="条形码">
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <LoadMask ShowMask="true" />
                        <SelectionModel>
                            <ext:RowSelectionModel>
                            </ext:RowSelectionModel>
                        </SelectionModel>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
</body>
</html>
